<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
    <link rel="stylesheet" type="text/css" href="CSS/register.css"/>
    <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.4.1.js"></script>
    <script type="text/javascript" src="JS/jqSession.js"></script>
</head>
<body>
<c:set value="${sessionScope.captcha.getCode()}" var="pcaptcha"></c:set>
<form>
    <p class="p1">读了么</p>
    <p class="p2">注册 读了么 在线购书</p>
    <div>
        <input id="userAccount" type="text" name="phone" placeholder="手机号"/><br><br>
        <input id="captcha" type="text" name="user_captcha" placeholder="请输入短信验证码"/><br>
        <span class="help-block u-errormessage" id="errorMsg">&nbsp;</span>
        <input type="button" id="get_captcha" value="获取验证码" />
        <input class="button1" type="button" name="submit" id ="register" value="立即注册" /><br><br>
        <p>注册即代表同意<a href="user_Agreement.html">《用户协议》</a></p><br><br>
    </div>
    <div class="register_bottom"><p class="p3">已有账号？<a href="Login.html">点此登录</a></p></div>
</form>
</body>
<script>
    $("#get_captcha").click(function () {
        var userAccount=$("#userAccount").val();
        $.post("/user/PCaptcha", "userAccount="+userAccount, function () {

        });
    });
    $("#register").click(function (){
        var userAccount=$("#userAccount").val();
        var captcha = $("#captcha").val();
        $.post("/User/Register", "userAccount="+userAccount+"&captcha="+captcha, function () {

        });
    });
</script>
</html>
